-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalculator.py
More file actions
47 lines (32 loc) · 840 Bytes
/
calculator.py
File metadata and controls
47 lines (32 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
a = int(input("Enter the first input:"))
b = int(input("Enter the second input:"))
c = int(input("enter the choice: "))
def addition():
add = a+b
return add
def substraction():
sub = a-b
return sub
def multiplication ():
mul = a*b
return mul
def division ():
div= a/b
return div
cont = input("you want to continue press yes otherwise no : ")
while cont == 1:
def match():
match c:
case 1:
return addition()
case 2:
return substraction()
case 3:
return multiplication()
case 4:
return division()
case _:
print("you entered wrong case.")
return match()
print(match())
cont = input("you want to continue press yes otherwise no : ")